#!/usr/bin/env bash

# export giteePullRequestIid=12
# export BUILD_DIR=/data/pr
# export giteeSourceBranch=docs-develop

set -e

conName="pr_"${giteePullRequestIid}
dir=${BUILD_DIR}/"pr_"${giteePullRequestIid}
cacheDir=${dir}/cache
publicDir=${dir}/publicDir
pr_port_file=${dir}/pr_port.txt

echo "giteePullRequestIid : ${giteePullRequestIid}"
echo "giteeTargetBranch   : ${giteeTargetBranch}"

echo "Backup Cache as $(date '+%Y-%m-%d %H:%M:%S')"
# 备份文件
mv .cache ${cacheDir}
rsync -rltgoD --delete public/ ${publicDir}
